package kz.pompei.ifacer.fonts;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.font.TextAttribute;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;

import javax.imageio.ImageIO;

import kz.pompei.ifacer.dialogs.FontUtil;

public class FontProbe {
  public static void main(String[] args) throws Exception {
    int w = 1800, h = 600;
    BufferedImage im = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    
    Graphics2D g = FontUtil.prepare(im.getGraphics());
    
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, w, h);
    g.setColor(Color.BLACK);
    
    int y = 0;
    
    g.setFont(new Font("ubuntu condensed", Font.PLAIN, 1).deriveFont(70f));
    String s = "Привет всем !!! Hello WORLD!!!";
    g.drawString(s, 10, y += 70);
    g.setFont(g.getFont().deriveFont(Font.BOLD));
    g.drawString(s, 10, y += 70);
    g.setFont(g.getFont().deriveFont(Font.ITALIC));
    g.drawString(s, 10, y += 70);
    g.setFont(g.getFont().deriveFont(Font.ITALIC + Font.BOLD));
    g.drawString(s, 10, y += 70);
    
    for (TextAttribute ta : g.getFont().getAttributes().keySet()) {
      System.out.println("TextAttribute " + ta);
    }
    
    g.dispose();
    
    ImageIO.write(im, "png", new FileOutputStream("out/FontProbe.png"));
    
    System.out.println("Complete");
  }
}
